import Vue from 'vue'
import Router from 'vue-router'

import backIndex from '@/components/back/index'
import frontCoach from '@/components/front/coach'
import publiccs from '@/components/public/cs'
import frontShopowner from '@/components/front/shopowner'
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/front/coach',
      name: 'frontCoach',
      component: frontCoach
    },
    {
      path: '/front/shopowner',
      name: 'frontShopowner',
      component: frontShopowner
    },
    {
      path: '/public/cs',
      name: 'publiccs',
      component: publiccs
    },
    {
      path: '/back',
      name: 'backIndex',
      component: backIndex,
      children: [
        {
          path: '/back/user',
          component: resolve => require(['@/components/back/user/'], resolve),
          meta: {title: '学员管理'}
        },
        {
          path: '/back/shopowner',
          component: resolve => require(['@/components/back/shopowner/'], resolve),
          meta: {title: '店长管理'}
        },
        {
          path: '/back/coach',
          component: resolve => require(['@/components/back/coach/'], resolve),
          meta: {title: '教练管理'}
        },
        {
          path: '/back/admin',
          component: resolve => require(['@/components/back/admin/'], resolve),
          meta: {title: '管理员管理'}
        },
        {
          path: '/back/CourseTemplate',
          component: resolve => require(['@/components/back/CourseTemplate/'], resolve),
          meta: {title: '课程模板管理'}
        },
        {
          path: '/back/store',
          component: resolve => require(['@/components/back/store/'], resolve),
          meta: {title: '门店管理'}
        },
        {
          path: '/back/coursetype',
          component: resolve => require(['@/components/back/coursetype/'], resolve),
          meta: {title: '课程类型管理'}
        },
        {
          path: '/back/news',
          component: resolve => require(['@/components/back/news/'], resolve),
          meta: {title: '新闻管理'}
        },
      ]}

  ]
})
